You are here: Symbol Reference > Dew Namespace > Dew.Stats Namespace > Dew.Stats.Units Namespace > Classes > Regress Class > Regress Methods > Regress.R2 Method
Dew Stats for .NET
ContentsIndexHome
PreviousUpNext
Regress.R2 Method

R2 value.

Syntax
C#
Visual Basic
public static double R2([In] TVec Y, [In] TVec YCalc);
Parameters 
Description 
[In] TVec Y 
Defines vector of dependant variable. 
[In] TVec YCalc 
Defines vector of estimated dependant variable values. 

The R2 value, in this case defined by the following equation: 

R2 = 1.0 - SumOfSquares(Y-YCalc)/SumOfSquares(Y-Mean(Y)) 

.

There are several ways to calculate R2, all equivalent for a linear model where model includes a constant term, but not equivalent otherwise.

Copyright (c) 1999-2024 by Dew Research. All rights reserved.
What do you think about this topic? Send feedback!